<?php
/**
 * Created by PhpStorm.
 * User: godjarvis
 * Date: 2020/08/05
 * Time: 09:22
 */

namespace App\Http\Controllers;

use App\Http\Requests\PageRequest;
use App\Model\Service\UserService;
use Fresh\Annotation\Authorize;
use Fresh\Annotation\Autowired;
use Fresh\Annotation\RequestMapping;
use Fresh\Mvc\Controller;

/**
 * @Authorize()
 */
class UserController extends Controller
{
    /**
     * @Autowired()
     * @var UserService
     */
    public $userService;

    /**
     * 用户信息页
     * @RequestMapping(value="/user/index")
     */
    public function indexAction()
    {
        return $this->userService->index();
    }

    /**
     * 客户列表页
     * @RequestMapping(value="/user/client")
     */
    public function clientListAction(PageRequest $request)
    {
        return $this->userService->clientList($request->page, $request->limit);
    }
}
